package com.dbtimer.dbupdatespring.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 测点的稳定信息，基本是不变的，且查询次数不频繁的信息
 * @author swx
 * @TableName point_info_stable
 */
@TableName(value ="point_info_stable")
@Data
public class PointInfoStableEntity implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 测点编号
     */
    @TableField(value = "point_index")
    private String pointIndex;

    /**
     * 实施该项目单位
     */
    @TableField(value = "department")
    private String department;

    /**
     * 生产产家
     */
    @TableField(value = "producer")
    private String producer;

    /**
     * 测点型号
     */
    @TableField(value = "point_model")
    private String pointModel;

    /**
     * 测量方式（人工测量、自动化测量）
     */
    @TableField(value = "way")
    private String way;

    /**
     * 出厂编号
     */
    @TableField(value = "factory_number")
    private String factoryNumber;

    /**
     * x轴坐标，单位：m
     */
    @TableField(value = "x_cor")
    private String xCor;

    /**
     * y轴坐标，单位：m
     */
    @TableField(value = "y_cor")
    private String yCor;

    /**
     * 高程信息，单位：m
     */
    @TableField(value = "z_cor")
    private String zCor;

    /**
     * 仪器安装时间
     */
    @TableField(value = "install_time")
    private Date installTime;

    /**
     * 基准时间
     */
    @TableField(value = "basic_time")
    private Date basicTime;

    /**
     * mcu单元
     */
    @TableField(value = "mcu_code")
    private String mcuCode;

    /**
     * mcu通道
     */
    @TableField(value = "mcu_channel")
    private String mcuChannel;

    /**
     * 备注信息
     */
    @TableField(value = "remarks")
    private String remarks;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PointInfoStableEntity other = (PointInfoStableEntity) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPointIndex() == null ? other.getPointIndex() == null : this.getPointIndex().equals(other.getPointIndex()))
            && (this.getDepartment() == null ? other.getDepartment() == null : this.getDepartment().equals(other.getDepartment()))
            && (this.getProducer() == null ? other.getProducer() == null : this.getProducer().equals(other.getProducer()))
            && (this.getPointModel() == null ? other.getPointModel() == null : this.getPointModel().equals(other.getPointModel()))
            && (this.getWay() == null ? other.getWay() == null : this.getWay().equals(other.getWay()))
            && (this.getFactoryNumber() == null ? other.getFactoryNumber() == null : this.getFactoryNumber().equals(other.getFactoryNumber()))
            && (this.getXCor() == null ? other.getXCor() == null : this.getXCor().equals(other.getXCor()))
            && (this.getYCor() == null ? other.getYCor() == null : this.getYCor().equals(other.getYCor()))
            && (this.getZCor() == null ? other.getZCor() == null : this.getZCor().equals(other.getZCor()))
            && (this.getInstallTime() == null ? other.getInstallTime() == null : this.getInstallTime().equals(other.getInstallTime()))
            && (this.getBasicTime() == null ? other.getBasicTime() == null : this.getBasicTime().equals(other.getBasicTime()))
            && (this.getMcuCode() == null ? other.getMcuCode() == null : this.getMcuCode().equals(other.getMcuCode()))
            && (this.getMcuChannel() == null ? other.getMcuChannel() == null : this.getMcuChannel().equals(other.getMcuChannel()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPointIndex() == null) ? 0 : getPointIndex().hashCode());
        result = prime * result + ((getDepartment() == null) ? 0 : getDepartment().hashCode());
        result = prime * result + ((getProducer() == null) ? 0 : getProducer().hashCode());
        result = prime * result + ((getPointModel() == null) ? 0 : getPointModel().hashCode());
        result = prime * result + ((getWay() == null) ? 0 : getWay().hashCode());
        result = prime * result + ((getFactoryNumber() == null) ? 0 : getFactoryNumber().hashCode());
        result = prime * result + ((getXCor() == null) ? 0 : getXCor().hashCode());
        result = prime * result + ((getYCor() == null) ? 0 : getYCor().hashCode());
        result = prime * result + ((getZCor() == null) ? 0 : getZCor().hashCode());
        result = prime * result + ((getInstallTime() == null) ? 0 : getInstallTime().hashCode());
        result = prime * result + ((getBasicTime() == null) ? 0 : getBasicTime().hashCode());
        result = prime * result + ((getMcuCode() == null) ? 0 : getMcuCode().hashCode());
        result = prime * result + ((getMcuChannel() == null) ? 0 : getMcuChannel().hashCode());
        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", pointIndex=").append(pointIndex);
        sb.append(", department=").append(department);
        sb.append(", producer=").append(producer);
        sb.append(", pointModel=").append(pointModel);
        sb.append(", way=").append(way);
        sb.append(", factoryNumber=").append(factoryNumber);
        sb.append(", xCor=").append(xCor);
        sb.append(", yCor=").append(yCor);
        sb.append(", zCor=").append(zCor);
        sb.append(", installTime=").append(installTime);
        sb.append(", basicTime=").append(basicTime);
        sb.append(", mcuCode=").append(mcuCode);
        sb.append(", mcuChannel=").append(mcuChannel);
        sb.append(", remarks=").append(remarks);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}